package com.yijushequ.action.place;


import com.yijushequ.action.BasicAction;
import com.yijushequ.dao.PlaceMarkDao;
import com.yijushequ.domain.PlaceMark;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import java.util.List;

@Controller
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
@Namespace(BasicAction.BASE_NAME_SPACE)
@Results({
        @Result(name = BasicAction.RESULT_JSON, type = BasicAction.RESULT_JSON)
})
public class LoadMarkAjaxAction extends BasicAction {

    private List<PlaceMark> placeMarks;

//    private


    private PlaceMarkDao placeMarkDao;


    @Action(value = "plaLA")
    public String plaLA() throws Exception {
        placeMarks = placeMarkDao.findAll();
        return RESULT_JSON;
    }

    public List<PlaceMark> getPlaceMarks() {
        return placeMarks;
    }

    public void setPlaceMarks(List<PlaceMark> placeMarks) {
        this.placeMarks = placeMarks;
    }

    public void setPlaceMarkDao(PlaceMarkDao placeMarkDao) {
        this.placeMarkDao = placeMarkDao;
    }
}
